﻿using NewAI.Game;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NewAI.FSM.JsonAnalyzerFSM
{
    public class DirectSendActionState : State<JsonAnalyzer>
    {
        private int roundID;
        private List<ActionObj> actionObjs;

        public DirectSendActionState(int roundID, List<ActionObj> actionObjs)
        {
            this.roundID = roundID;
            this.actionObjs = actionObjs;
        }

        public override void Enter(JsonAnalyzer entity)
        {
            entity.CloseTimeOutTimer();
            PubliceMessage.ActionTimeOut.Call(null, null);
            ActionData actionData = new ActionData(roundID, actionObjs);
            entity.ActionMessage.Call(null, new FSMEventEventArg(actionData.GetActionDataString()));
            actionObjs.Clear();
        }
    }
}
